import fetch from 'common/src/utils/fetch'
const api_name = 'api/welcomeservice'
const group_name = 'tutorChangeLog'
const group_name_two = 'tutorList'
const group_name_three = 'tutorCount'
const group_name_four = 'tutorStudent'
const group_name_five = 'tutorGuidanceRecords'

/**
 *导师变更日志导出
 */

function exportTutorLog(data){
    return fetch({
        url: `${api_name}/${group_name}/excel`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *学生导师关系导出
 */

function exportStuTutor(data){
    return fetch({
        url: `${api_name}/${group_name_four}/excel`,
        method: 'post',
        data:data,
        showMask: false
    });
}
/**
 *导师库导出
 */

function exportTutor(data){
    return fetch({
        url: `${api_name}/${group_name_two}/excel`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *学生人数统计导出
 */

function exportStuNumber(data){
    return fetch({
        url: `${api_name}/${group_name_four}/excel/count`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *导师指导记录导出
 */

function exportTutorGuide(data){
    return fetch({
        url: `${api_name}/${group_name_five}/excel`,
        method: 'post',
        data:data,
        showMask: false
    });
}
/**
 *导师指导记录统计导出
 */

function exportGuidance(data){
    return fetch({
        url: `${api_name}/${group_name_five}/excel/count`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *导出导师人数统计表
 */

function exportTutorNumber(data){
    return fetch({
        url: `${api_name}/${group_name_three}/excel/count`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *导出导师人数汇总
 */

function exportTutorNumberTotal(data){
    return fetch({
        url: `${api_name}/${group_name_three}/excel/noTitle`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *导出导师名单
 */

function exportTutorList(data){
    return fetch({
        url: `${api_name}/${group_name_three}/excel/countTutors`,
        method: 'post',
        data:data,
        showMask: false
    });
}

/**
 *下载导师导入模板
 */

function tutorTemplate(type){
    return  `${api_name}/${group_name_two}/template/tutor/${type}`
}


/**
 *下载聘用年度导入模板
 */

function gradeTemplate(type){
    return `${api_name}/${group_name_two}/template/grade/${type}`
}


/**
 *下载导师管理导入模板
 */

function tutorManageTemplate(type){
    return  `${api_name}/${group_name_four}/template/${type}` 
}

/**
 * 循环获取导出状态
 */
function getReportStatus(key) {
    return fetch({
        url: `${api_name}/${group_name_three}/result/${key}`,
        method: 'get'
    });
}


/**
 * 循环获取导入状态
 */
function getImportStatus(key) {
    return fetch({
        url: `${api_name}/${group_name_two}/import/${key}`,
        method: 'get'
    });
}

export default {
    exportTutorLog:exportTutorLog,
    getReportStatus:getReportStatus,
    exportTutor:exportTutor,
    exportStuTutor:exportStuTutor,
    exportStuNumber:exportStuNumber,
    exportTutorGuide:exportTutorGuide,
    exportGuidance:exportGuidance,
    exportTutorNumber:exportTutorNumber,
    exportTutorNumberTotal:exportTutorNumberTotal,
    exportTutorList:exportTutorList,
    exportLogUrl: `${api_name}/${group_name_three}/export?path=`,
    tutorTemplate:tutorTemplate,
    gradeTemplate:gradeTemplate,
    tutorManageTemplate:tutorManageTemplate,
    getImportStatus:getImportStatus
}